﻿@page
@using Microsoft.AspNetCore.Authorization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@using AdminFrame.Permissions
@using AdminFrame.Web.Pages.Parameters
@using AdminFrame.Web.Menus
@using Microsoft.AspNetCore.Mvc.Localization
@using AdminFrame.Localization
@inject IHtmlLocalizer<AdminFrameResource> L
@inject IAuthorizationService Authorization

@model AdminFrame.Web.Pages.Parameters.IndexModel

@inject IPageLayout PageLayout
@{
    PageLayout.Content.Title = L["SysManagement"].Value;
    PageLayout.Content.MenuItemName = AdminFrameMenus.Parameters;
}

@section styles
{
}

@section scripts
{
    <abp-script src="/Pages/Parameters/index.js" />
}


@section content_toolbar {

    @if (await Authorization.IsGrantedAsync(AdminFramePermissions.ParametersCreate))
    {
        <abp-button id="NewParameterButton" text="@L["Create"].Value" icon="plus" size="Small" button-type="Primary" />
    }
}

<abp-card>
    <abp-card-body>
        <abp-row class="mb-3">
            <abp-column size-md="_12">
                <form id="SearchForm" autocomplete="off">
                    <div class="input-group">
                        <input class="form-control page-search-filter-text" id="FilterText" placeholder="@L["Search"]" />
                        <abp-button button-type="Primary" type="submit" icon="search" />
                    </div>
                </form>
            </abp-column>
            <abp-column size-md="_12" class="mt-3">
                <a href="javascript:;" id="AdvancedFilterSectionToggler" class="text-decoration-none">@L["AdvancedFilters"]</a>
            </abp-column>
        </abp-row>

        <!-- 搜索表单 -->
        <abp-row id="AdvancedFilterSection" style="display: none;">
            @* 名称 *@
            <abp-column size="_3">
                <abp-input asp-for="NameFilter" label="@L["Name"].Value" />
            </abp-column>
            @* 代码 *@
            <abp-column size="_3">
                <abp-input asp-for="CodeFilter" label="@L["Code"].Value" />
            </abp-column>
            @* 类型 *@
            <abp-column size="_3">
                <abp-select asp-for="TypeFilter" label="@L["Type"].Value" />
            </abp-column>
            @* 是否启用 *@
            <abp-column size="_3">
                <abp-select asp-for="IsActiveFilter" label="@L["IsActive"].Value" />
            </abp-column>
            @* 描述 *@
            <abp-column size="_3">
                <abp-input asp-for="DescriptionFilter" label="@L["Description"].Value" />
            </abp-column>
        </abp-row>
        <abp-row>
            <abp-column size="_12" class="text-end">
                <abp-button id="SearchButton" type="button" text="@L["Search"].Value" button-type="Primary" />
                <abp-button id="ClearButton" type="button" text="@L["Clear"].Value" button-type="Secondary" />
                @* <abp-button type="submit" text="@L["Search"].Value" button-type="Primary" />
                <abp-button type="reset" text="@L["Clear"].Value" button-type="Secondary" /> *@
            </abp-column>
        </abp-row>

        <abp-table striped-rows="true" id="ParametersTable">
            <thead>
                <tr>
                    <th>@L["Actions"]</th>
                    <th>@L["Name"]</th>
                    <th>@L["Code"]</th>
                    <th>@L["Type"]</th>
                    <th>@L["IsActive"]</th>
                    <th>@L["Description"]</th>
                </tr>
            </thead>
        </abp-table>
    </abp-card-body>
</abp-card>
